Integrand size = 19, antiderivative size = 108 \[ \int (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\frac {3}{8} \left (a^2+b^2\right )^2 x-\frac {3 \left (a^2+b^2\right ) (b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))}{8 d}-\frac {(b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))^3}{4 d} \]
3/8*(a^2+b^2)^2*x-3/8*(a^2+b^2)*(b*cos(d*x+c)-a*sin(d*x+c))*(a*cos(d*x+c)+ b*sin(d*x+c))/d-1/4*(b*cos(d*x+c)-a*sin(d*x+c))*(a*cos(d*x+c)+b*sin(d*x+c) )^3/d
Time = 1.11 (sec) , antiderivative size = 107, normalized size of antiderivative = 0.99 \[ \int (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\frac {12 \left (a^2+b^2\right )^2 (c+d x)-16 a b \left (a^2+b^2\right ) \cos (2 (c+d x))-4 a b \left (a^2-b^2\right ) \cos (4 (c+d x))+8 \left (a^4-b^4\right ) \sin (2 (c+d x))+\left (a^4-6 a^2 b^2+b^4\right ) \sin (4 (c+d x))}{32 d} \]
(12*(a^2 + b^2)^2*(c + d*x) - 16*a*b*(a^2 + b^2)*Cos[2*(c + d*x)] - 4*a*b* (a^2 - b^2)*Cos[4*(c + d*x)] + 8*(a^4 - b^4)*Sin[2*(c + d*x)] + (a^4 - 6*a ^2*b^2 + b^4)*Sin[4*(c + d*x)])/(32*d)
Time = 0.30 (sec) , antiderivative size = 111, normalized size of antiderivative = 1.03, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.263, Rules used = {3042, 3552, 3042, 3552, 24}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int (a \cos (c+d x)+b \sin (c+d x))^4 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (a \cos (c+d x)+b \sin (c+d x))^4dx\) |
\(\Big \downarrow \) 3552 |
\(\displaystyle \frac {3}{4} \left (a^2+b^2\right ) \int (a \cos (c+d x)+b \sin (c+d x))^2dx-\frac {(b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))^3}{4 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {3}{4} \left (a^2+b^2\right ) \int (a \cos (c+d x)+b \sin (c+d x))^2dx-\frac {(b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))^3}{4 d}\) |
\(\Big \downarrow \) 3552 |
\(\displaystyle \frac {3}{4} \left (a^2+b^2\right ) \left (\frac {1}{2} \left (a^2+b^2\right ) \int 1dx-\frac {(b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))}{2 d}\right )-\frac {(b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))^3}{4 d}\) |
\(\Big \downarrow \) 24 |
\(\displaystyle \frac {3}{4} \left (a^2+b^2\right ) \left (\frac {1}{2} x \left (a^2+b^2\right )-\frac {(b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))}{2 d}\right )-\frac {(b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))^3}{4 d}\) |
-1/4*((b*Cos[c + d*x] - a*Sin[c + d*x])*(a*Cos[c + d*x] + b*Sin[c + d*x])^ 3)/d + (3*(a^2 + b^2)*(((a^2 + b^2)*x)/2 - ((b*Cos[c + d*x] - a*Sin[c + d* x])*(a*Cos[c + d*x] + b*Sin[c + d*x]))/(2*d)))/4
3.1.79.3.1 Defintions of rubi rules used
Int[(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x _Symbol] :> Simp[(-(b*Cos[c + d*x] - a*Sin[c + d*x]))*((a*Cos[c + d*x] + b* Sin[c + d*x])^(n - 1)/(d*n)), x] + Simp[(n - 1)*((a^2 + b^2)/n) Int[(a*Co s[c + d*x] + b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{a, b, c, d}, x] && N eQ[a^2 + b^2, 0] && !IntegerQ[(n - 1)/2] && GtQ[n, 1]
Time = 1.05 (sec) , antiderivative size = 135, normalized size of antiderivative = 1.25
method | result | size |
parallelrisch | \(\frac {\left (a^{4}-6 a^{2} b^{2}+b^{4}\right ) \sin \left (4 d x +4 c \right )+16 \left (-a^{3} b -a \,b^{3}\right ) \cos \left (2 d x +2 c \right )+4 \left (-a^{3} b +a \,b^{3}\right ) \cos \left (4 d x +4 c \right )+8 \left (a^{4}-b^{4}\right ) \sin \left (2 d x +2 c \right )+12 a^{4} d x +24 a^{2} b^{2} d x +12 b^{4} d x +20 a^{3} b +12 a \,b^{3}}{32 d}\) | \(135\) |
derivativedivides | \(\frac {a^{4} \left (\frac {\left (\cos \left (d x +c \right )^{3}+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )-a^{3} b \cos \left (d x +c \right )^{4}+6 a^{2} b^{2} \left (-\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )^{3}}{4}+\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{8}+\frac {d x}{8}+\frac {c}{8}\right )+a \,b^{3} \sin \left (d x +c \right )^{4}+b^{4} \left (-\frac {\left (\sin \left (d x +c \right )^{3}+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )}{d}\) | \(153\) |
default | \(\frac {a^{4} \left (\frac {\left (\cos \left (d x +c \right )^{3}+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )-a^{3} b \cos \left (d x +c \right )^{4}+6 a^{2} b^{2} \left (-\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )^{3}}{4}+\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{8}+\frac {d x}{8}+\frac {c}{8}\right )+a \,b^{3} \sin \left (d x +c \right )^{4}+b^{4} \left (-\frac {\left (\sin \left (d x +c \right )^{3}+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )}{d}\) | \(153\) |
parts | \(\frac {a^{4} \left (\frac {\left (\cos \left (d x +c \right )^{3}+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )}{d}+\frac {b^{4} \left (-\frac {\left (\sin \left (d x +c \right )^{3}+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )}{d}+\frac {a \,b^{3} \sin \left (d x +c \right )^{4}}{d}+\frac {6 a^{2} b^{2} \left (-\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )^{3}}{4}+\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{8}+\frac {d x}{8}+\frac {c}{8}\right )}{d}-\frac {a^{3} b \cos \left (d x +c \right )^{4}}{d}\) | \(164\) |
risch | \(\frac {3 a^{4} x}{8}+\frac {3 a^{2} b^{2} x}{4}+\frac {3 b^{4} x}{8}-\frac {a^{3} b \cos \left (4 d x +4 c \right )}{8 d}+\frac {a \,b^{3} \cos \left (4 d x +4 c \right )}{8 d}+\frac {\sin \left (4 d x +4 c \right ) a^{4}}{32 d}-\frac {3 \sin \left (4 d x +4 c \right ) a^{2} b^{2}}{16 d}+\frac {\sin \left (4 d x +4 c \right ) b^{4}}{32 d}-\frac {a^{3} b \cos \left (2 d x +2 c \right )}{2 d}-\frac {a \,b^{3} \cos \left (2 d x +2 c \right )}{2 d}+\frac {a^{4} \sin \left (2 d x +2 c \right )}{4 d}-\frac {\sin \left (2 d x +2 c \right ) b^{4}}{4 d}\) | \(183\) |
norman | \(\frac {\left (\frac {3}{8} a^{4}+\frac {3}{4} a^{2} b^{2}+\frac {3}{8} b^{4}\right ) x +\left (\frac {3}{2} a^{4}+3 a^{2} b^{2}+\frac {3}{2} b^{4}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\left (\frac {3}{2} a^{4}+3 a^{2} b^{2}+\frac {3}{2} b^{4}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}+\left (\frac {3}{8} a^{4}+\frac {3}{4} a^{2} b^{2}+\frac {3}{8} b^{4}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}+\left (\frac {9}{4} a^{4}+\frac {9}{2} a^{2} b^{2}+\frac {9}{4} b^{4}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\frac {16 a \,b^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{d}+\frac {8 a^{3} b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{d}+\frac {8 a^{3} b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}}{d}-\frac {\left (3 a^{4}-42 a^{2} b^{2}+11 b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{4 d}+\frac {\left (3 a^{4}-42 a^{2} b^{2}+11 b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{4 d}+\frac {\left (5 a^{4}-6 a^{2} b^{2}-3 b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}-\frac {\left (5 a^{4}-6 a^{2} b^{2}-3 b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{4 d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{4}}\) | \(365\) |
1/32*((a^4-6*a^2*b^2+b^4)*sin(4*d*x+4*c)+16*(-a^3*b-a*b^3)*cos(2*d*x+2*c)+ 4*(-a^3*b+a*b^3)*cos(4*d*x+4*c)+8*(a^4-b^4)*sin(2*d*x+2*c)+12*a^4*d*x+24*a ^2*b^2*d*x+12*b^4*d*x+20*a^3*b+12*a*b^3)/d
Time = 0.25 (sec) , antiderivative size = 121, normalized size of antiderivative = 1.12 \[ \int (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=-\frac {16 \, a b^{3} \cos \left (d x + c\right )^{2} + 8 \, {\left (a^{3} b - a b^{3}\right )} \cos \left (d x + c\right )^{4} - 3 \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} d x - {\left (2 \, {\left (a^{4} - 6 \, a^{2} b^{2} + b^{4}\right )} \cos \left (d x + c\right )^{3} + {\left (3 \, a^{4} + 6 \, a^{2} b^{2} - 5 \, b^{4}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{8 \, d} \]
-1/8*(16*a*b^3*cos(d*x + c)^2 + 8*(a^3*b - a*b^3)*cos(d*x + c)^4 - 3*(a^4 + 2*a^2*b^2 + b^4)*d*x - (2*(a^4 - 6*a^2*b^2 + b^4)*cos(d*x + c)^3 + (3*a^ 4 + 6*a^2*b^2 - 5*b^4)*cos(d*x + c))*sin(d*x + c))/d
Leaf count of result is larger than twice the leaf count of optimal. 381 vs. \(2 (102) = 204\).
Time = 0.21 (sec) , antiderivative size = 381, normalized size of antiderivative = 3.53 \[ \int (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\begin {cases} \frac {3 a^{4} x \sin ^{4}{\left (c + d x \right )}}{8} + \frac {3 a^{4} x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {3 a^{4} x \cos ^{4}{\left (c + d x \right )}}{8} + \frac {3 a^{4} \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} + \frac {5 a^{4} \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} - \frac {a^{3} b \cos ^{4}{\left (c + d x \right )}}{d} + \frac {3 a^{2} b^{2} x \sin ^{4}{\left (c + d x \right )}}{4} + \frac {3 a^{2} b^{2} x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{2} + \frac {3 a^{2} b^{2} x \cos ^{4}{\left (c + d x \right )}}{4} + \frac {3 a^{2} b^{2} \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{4 d} - \frac {3 a^{2} b^{2} \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{4 d} + \frac {a b^{3} \sin ^{4}{\left (c + d x \right )}}{d} + \frac {3 b^{4} x \sin ^{4}{\left (c + d x \right )}}{8} + \frac {3 b^{4} x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {3 b^{4} x \cos ^{4}{\left (c + d x \right )}}{8} - \frac {5 b^{4} \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} - \frac {3 b^{4} \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} & \text {for}\: d \neq 0 \\x \left (a \cos {\left (c \right )} + b \sin {\left (c \right )}\right )^{4} & \text {otherwise} \end {cases} \]
Piecewise((3*a**4*x*sin(c + d*x)**4/8 + 3*a**4*x*sin(c + d*x)**2*cos(c + d *x)**2/4 + 3*a**4*x*cos(c + d*x)**4/8 + 3*a**4*sin(c + d*x)**3*cos(c + d*x )/(8*d) + 5*a**4*sin(c + d*x)*cos(c + d*x)**3/(8*d) - a**3*b*cos(c + d*x)* *4/d + 3*a**2*b**2*x*sin(c + d*x)**4/4 + 3*a**2*b**2*x*sin(c + d*x)**2*cos (c + d*x)**2/2 + 3*a**2*b**2*x*cos(c + d*x)**4/4 + 3*a**2*b**2*sin(c + d*x )**3*cos(c + d*x)/(4*d) - 3*a**2*b**2*sin(c + d*x)*cos(c + d*x)**3/(4*d) + a*b**3*sin(c + d*x)**4/d + 3*b**4*x*sin(c + d*x)**4/8 + 3*b**4*x*sin(c + d*x)**2*cos(c + d*x)**2/4 + 3*b**4*x*cos(c + d*x)**4/8 - 5*b**4*sin(c + d* x)**3*cos(c + d*x)/(8*d) - 3*b**4*sin(c + d*x)*cos(c + d*x)**3/(8*d), Ne(d , 0)), (x*(a*cos(c) + b*sin(c))**4, True))
Time = 0.23 (sec) , antiderivative size = 136, normalized size of antiderivative = 1.26 \[ \int (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=-\frac {a^{3} b \cos \left (d x + c\right )^{4}}{d} + \frac {a b^{3} \sin \left (d x + c\right )^{4}}{d} + \frac {{\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} a^{4}}{32 \, d} + \frac {3 \, {\left (4 \, d x + 4 \, c - \sin \left (4 \, d x + 4 \, c\right )\right )} a^{2} b^{2}}{16 \, d} + \frac {{\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) - 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} b^{4}}{32 \, d} \]
-a^3*b*cos(d*x + c)^4/d + a*b^3*sin(d*x + c)^4/d + 1/32*(12*d*x + 12*c + s in(4*d*x + 4*c) + 8*sin(2*d*x + 2*c))*a^4/d + 3/16*(4*d*x + 4*c - sin(4*d* x + 4*c))*a^2*b^2/d + 1/32*(12*d*x + 12*c + sin(4*d*x + 4*c) - 8*sin(2*d*x + 2*c))*b^4/d
Time = 0.31 (sec) , antiderivative size = 122, normalized size of antiderivative = 1.13 \[ \int (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\frac {3}{8} \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} x - \frac {{\left (a^{3} b - a b^{3}\right )} \cos \left (4 \, d x + 4 \, c\right )}{8 \, d} - \frac {{\left (a^{3} b + a b^{3}\right )} \cos \left (2 \, d x + 2 \, c\right )}{2 \, d} + \frac {{\left (a^{4} - 6 \, a^{2} b^{2} + b^{4}\right )} \sin \left (4 \, d x + 4 \, c\right )}{32 \, d} + \frac {{\left (a^{4} - b^{4}\right )} \sin \left (2 \, d x + 2 \, c\right )}{4 \, d} \]
3/8*(a^4 + 2*a^2*b^2 + b^4)*x - 1/8*(a^3*b - a*b^3)*cos(4*d*x + 4*c)/d - 1 /2*(a^3*b + a*b^3)*cos(2*d*x + 2*c)/d + 1/32*(a^4 - 6*a^2*b^2 + b^4)*sin(4 *d*x + 4*c)/d + 1/4*(a^4 - b^4)*sin(2*d*x + 2*c)/d
Time = 24.14 (sec) , antiderivative size = 320, normalized size of antiderivative = 2.96 \[ \int (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\frac {3\,\mathrm {atan}\left (\frac {3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,{\left (a^2+b^2\right )}^2}{4\,\left (\frac {3\,a^4}{4}+\frac {3\,a^2\,b^2}{2}+\frac {3\,b^4}{4}\right )}\right )\,{\left (a^2+b^2\right )}^2}{4\,d}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\,\left (-\frac {5\,a^4}{4}+\frac {3\,a^2\,b^2}{2}+\frac {3\,b^4}{4}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (\frac {3\,a^4}{4}-\frac {21\,a^2\,b^2}{2}+\frac {11\,b^4}{4}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (\frac {3\,a^4}{4}-\frac {21\,a^2\,b^2}{2}+\frac {11\,b^4}{4}\right )-\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (-\frac {5\,a^4}{4}+\frac {3\,a^2\,b^2}{2}+\frac {3\,b^4}{4}\right )+8\,a^3\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+16\,a\,b^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+8\,a^3\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}-\frac {3\,\left (\mathrm {atan}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )-\frac {d\,x}{2}\right )\,{\left (a^2+b^2\right )}^2}{4\,d} \]
(3*atan((3*tan(c/2 + (d*x)/2)*(a^2 + b^2)^2)/(4*((3*a^4)/4 + (3*b^4)/4 + ( 3*a^2*b^2)/2)))*(a^2 + b^2)^2)/(4*d) + (tan(c/2 + (d*x)/2)^7*((3*b^4)/4 - (5*a^4)/4 + (3*a^2*b^2)/2) - tan(c/2 + (d*x)/2)^3*((3*a^4)/4 + (11*b^4)/4 - (21*a^2*b^2)/2) + tan(c/2 + (d*x)/2)^5*((3*a^4)/4 + (11*b^4)/4 - (21*a^2 *b^2)/2) - tan(c/2 + (d*x)/2)*((3*b^4)/4 - (5*a^4)/4 + (3*a^2*b^2)/2) + 8* a^3*b*tan(c/2 + (d*x)/2)^2 + 16*a*b^3*tan(c/2 + (d*x)/2)^4 + 8*a^3*b*tan(c /2 + (d*x)/2)^6)/(d*(4*tan(c/2 + (d*x)/2)^2 + 6*tan(c/2 + (d*x)/2)^4 + 4*t an(c/2 + (d*x)/2)^6 + tan(c/2 + (d*x)/2)^8 + 1)) - (3*(atan(tan(c/2 + (d*x )/2)) - (d*x)/2)*(a^2 + b^2)^2)/(4*d)